package daoImpl;

import java.util.ArrayList;
import java.util.List;

import model.Room;
import dao.RoomDao;


public class RoomDaoImpl implements RoomDao{
	
	public List<Room>	rooms	= new ArrayList<Room>();
	
	
	public void add( Room room ) {
		rooms.add( room );
	}
	
	
	public void delete( Room room ) {
		rooms.remove( room );
	}
	
	
	public void update( Room room ) {
	}


	@Override
	public boolean roomExists( long room_id ) {
		for(Room room : rooms){
			if(room.getId()==room_id){
				return true;
			}
		}
		return false;
	}


	@Override
	public Room getRoom( int room_id ) {
		for(Room room : rooms){
			if(room.getId()==room_id){
				return room;
			}
		}
		return null;
	}


	@Override
	public List<Room> getRooms() {
		return rooms;
	}


	@Override
	public void setMemento( List<Room> rooms ) {
		this.rooms = rooms;
	}
}
